#coding:utf-8
ServiceName = 'pyScanner'

import os
import subprocess

cmdP = subprocess.Popen("sc query %s" % ServiceName, shell=True, stdout=subprocess.PIPE)
cmdP.wait()
cmdoutprint = cmdP.stdout.read()
if not "RUNNING" in cmdoutprint:
    print os.system("sc start %s" % ServiceName)


#TODO:
#Beanstalk
#log(pyWin32ServiveRunningStateFlag)

